import { IDataWithError } from '../../typing/service-typing'
import {
  ICheckMobileVerifyCodeData,
  ICheckMobileVerifyCodeParam,
  IClientService,
  ISendMobileVerifyCodeParam,
  IVerifyCodeData
} from '../../typing/service/IClientService'
import { HttpTransfer } from '../transfer/transfer'
import { IClientURL } from '../transfer/urls/client-url'

export class ClientService implements IClientService {
  constructor(private readonly http: HttpTransfer, private readonly urls: IClientURL) {}

  sendMobileVerifyCode(param: ISendMobileVerifyCodeParam): Promise<IDataWithError<IVerifyCodeData, any>> {
    return this.http.request(this.urls.sendMobileVerifyCode, param)
  }
  checkMobileVerifyCode(param: ICheckMobileVerifyCodeParam): Promise<IDataWithError<ICheckMobileVerifyCodeData, any>> {
    return this.http.request(this.urls.checkMobileVerifyCode, param)
  }
}
